package com.bing.dto.enumutil;

import com.bing.utils.exception.ServiceException;

/**
 * Created by hurl on 2019-09-03
 */
public enum RecommeType {

    RECOMME("111300000010", "不推荐"), //abc
    UNRECOMME("111300000020","推荐"); //bac


    private String code;
    private String name;

    RecommeType(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static RecommeType getValue(String code){
        RecommeType[] values = RecommeType.values();
        for (RecommeType value:values){
            if(value.getCode().equals(code)){
                return value ;
            }
        }
        return null;
        //throw new ServiceException("code="+code+"找不到题目类型");
    }

    public  static  String getName(String code){
        for (ProductClassifType value: ProductClassifType.values()){
            if (value.getCode().equals(code)){
                return value.getName();
            }
        }
        return null;
    }
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
